/*
 * main.cpp
 *
 *  Created on: May 26, 2010
 *      Author: rc
 */
#include <iostream>
#include "View/headers/Window.h"
#include "Model/headers/Die.h"
#include "SDL/SDL_events.h"
#include "Model/headers/Board.h"
#include "Controller/headers/BoardController.h"
#include "View/headers/BoardView.h"

using namespace std;

void handle(SDL_KeyboardEvent * evt){
	cout << "Keyboard event is: " << evt->keysym.sym<< endl;
}

int main() {   
    SDL_Event event;
    bool running = true;
    Window *window = new Window();

    Board *b = new Board();
    BoardController *bc = new BoardController(b);
    BoardView *bw = new BoardView(bc);
//
//    bc->addPiece(Board::WHITE, 0);
//    bc->addPiece(Board::WHITE, 1);
//    bc->movePiece(0,1);
    

    
    
    

    while(running) {
        while(SDL_PollEvent(&event)) {
            if(event.type == SDL_KEYDOWN) {
                handle(&event.key);
            }
            else if(event.type == SDL_QUIT) {
                running = false;
            }
        }
    }

    /*
	while(running) {
		while(SDL_PollEvent(&event)) {
			switch(event.type) {
				case SDL_KEYDOWN :
					handle(&event.key);
					break;
				case SDL_QUIT :
					running = false;
					break;
			}
		}
	}
    */
	return 0;
}
